import React from 'react'
import "./header.css"

export default function Headers(props) {
    const goBack = ()=> {
        props.history.go(-1)
    }
    const register = () => {
        props.history.push("/register")
    }
    return (
        <div>
            <div className="header_header">
                {
                    props.back?<div className="back" onClick={()=>goBack()}>返回</div>:null
                }
                
                <h3>{props.title}</h3>
                {
                    props.register?<div className="register" onClick={()=>register()}>注册</div>:null
                }
                
            </div>
        </div>
    )
}
